import { BasicColumn, FormSchema } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '参数名称',
    dataIndex: 'name',
    width: 120,
  },
  {
    title: '参数值',
    dataIndex: 'value',
    width: 120,
  },
  {
    title: '参数类型',
    dataIndex: 'type',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'account',
    label: '用户名',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'nickname',
    label: '昵称',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const globalParametersFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: '参数名称',
    component: 'Input',
    rules: [
      {
        required: true,
        message: '请输入参数名',
      },
    ],
  },
  {
    field: 'value',
    label: '参数值',
    component: 'Input',
    required: true,
  },
  {
    label: '类型',
    field: 'type',
    component: 'Select',
    componentProps: {
      options: [
        {
          label: 'header',
          value: 'header',
          key: 'header',
        },
        {
          label: 'query',
          value: 'query',
          key: 'query',
        },
      ],
    },
    required: true,
  },
];
